﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace MapTool
{
    [Serializable]
    public class PointId : INotifyPropertyChanged
    {
        public int X { get; set; }
        public int Y { get; set; }
        public int Id { get; set; }

        public string Key { get; set; }

        public ResultEnum Result{ get; set; }

        public Color SetColor { get; set; }

        //相对Mark点的XY偏移
        public double DisXToMark { get; set; }
        public double DisYToMark { get; set; }

        public PointId(int x, int y, double disXToMark, double disYToMark)
        {
            X = x;
            Y = y;
            DisXToMark = disXToMark;
            DisYToMark = disYToMark;
        }
     

        public PointId()
        {
        }

        public PointId Copy()
        {
            return new PointId
            {
                X = this.X,
                Y = this.Y,
                Id = this.Id,
                Key = this.Key,
                Result = this.Result,
                SetColor = this.SetColor,
                DisXToMark = this.DisXToMark,
                DisYToMark = this.DisYToMark
            };
        }


        public event PropertyChangedEventHandler? PropertyChanged;

        public void OnPropertyChanging([CallerMemberName] string? propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

     
    }
}
